<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>WinCache Statistics Script</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="wincache.configuration.html">运行时配置</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="wincache.sessionhandler.html">WinCache Session Handler</a></div>
 <div class="up"><a href="wincache.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="wincache.stats" class="section">
  <h2 class="title">WinCache Statistics Script</h2>
  <p class="para">
   The installation package for WinCache includes a PHP script, 
   <var class="filename">wincache.php</var>, that can be used to obtain cache information 
   and statistics.
  </p>
  <p class="para">
   If the WinCache extension was installed via the Microsoft Web Platform Installer, 
   then this script is located in 
   <var class="filename">%SystemDrive%\Program Files\IIS\Windows Cache for PHP\</var>. 
   On a 64-bit version of the Windows Server operating system, the script is located in 
   <var class="filename">%SystemDrive%\Program Files (x86)\IIS\Windows Cache for PHP</var>. 
   If the extension was installed manually, then the <var class="filename">wincache.php</var> 
   will be located in the same folder from which the content of the installation package was extracted.
  </p>
  <p class="para">
   To use <var class="filename">wincache.php</var>, copy it into a root folder of a Web site or 
   into any subfolder. To protect the script, open it in any text editor and replace the values for 
   <em class="emphasis">USERNAME</em> and <em class="emphasis">PASSWORD</em> constants. 
   If any other IIS authentication is enabled on the server, then
   follow the instructions in the comments:
   <div class="example" id="example-529">
    <p><strong>Example #1 Authentication configuration for <var class="filename">wincache.php</var></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;========================&nbsp;CONFIGURATION&nbsp;SETTINGS&nbsp;==============================<br />&nbsp;*&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;want&nbsp;to&nbsp;use&nbsp;authentication&nbsp;for&nbsp;this&nbsp;page,&nbsp;set&nbsp;USE_AUTHENTICATION&nbsp;to&nbsp;0.<br />&nbsp;*&nbsp;If&nbsp;you&nbsp;use&nbsp;authentication&nbsp;then&nbsp;replace&nbsp;the&nbsp;default&nbsp;password.<br />&nbsp;*/<br /></span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'USE_AUTHENTICATION'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'USERNAME'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'wincache'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'PASSWORD'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'wincache'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;The&nbsp;Basic&nbsp;PHP&nbsp;authentication&nbsp;will&nbsp;work&nbsp;only&nbsp;when&nbsp;IIS&nbsp;is&nbsp;configured&nbsp;to&nbsp;support&nbsp;<br />&nbsp;*&nbsp;Anonymous&nbsp;Authentication'&nbsp;and&nbsp;nothing&nbsp;else.&nbsp;If&nbsp;IIS&nbsp;is&nbsp;configured&nbsp;to&nbsp;support/use<br />&nbsp;*&nbsp;any&nbsp;other&nbsp;kind&nbsp;of&nbsp;authentication&nbsp;like&nbsp;Basic/Negotiate/Digest&nbsp;etc,&nbsp;this&nbsp;will&nbsp;not&nbsp;work.<br />&nbsp;*&nbsp;In&nbsp;that&nbsp;case&nbsp;use&nbsp;the&nbsp;array&nbsp;below&nbsp;to&nbsp;define&nbsp;the&nbsp;names&nbsp;of&nbsp;users&nbsp;in&nbsp;your&nbsp;<br />&nbsp;*&nbsp;domain/network/workgroup&nbsp;which&nbsp;you&nbsp;want&nbsp;to&nbsp;grant&nbsp;access&nbsp;to.<br />&nbsp;*/<br /></span><span style="color: #0000BB">$user_allowed&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'DOMAIN\user1'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'DOMAIN\user2'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'DOMAIN\user3'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;If&nbsp;the&nbsp;array&nbsp;contains&nbsp;string&nbsp;'all',&nbsp;then&nbsp;all&nbsp;the&nbsp;users&nbsp;authenticated&nbsp;by&nbsp;IIS<br />&nbsp;*&nbsp;will&nbsp;have&nbsp;access&nbsp;to&nbsp;the&nbsp;page.&nbsp;Uncomment&nbsp;the&nbsp;below&nbsp;line&nbsp;and&nbsp;comment&nbsp;above&nbsp;line<br />&nbsp;*&nbsp;to&nbsp;grant&nbsp;access&nbsp;to&nbsp;all&nbsp;users&nbsp;who&nbsp;gets&nbsp;authenticated&nbsp;by&nbsp;IIS.<br />&nbsp;*/<br />/*&nbsp;$user_allowed&nbsp;=&nbsp;array('all');&nbsp;*/<br /><br />/**&nbsp;=====================&nbsp;END&nbsp;OF&nbsp;CONFIGURATION&nbsp;SETTINGS&nbsp;==========================&nbsp;*/<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <span class="simpara">
     Always protect the <var class="filename">wincache.php</var> script by using either 
     the built-in authentication or the server&#039;s authentication mechanism. 
     Leaving this script unprotected may compromise the security of your 
     web application and web server.
    </span>
   </p></blockquote>
  </p>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="wincache.configuration.html">运行时配置</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="wincache.sessionhandler.html">WinCache Session Handler</a></div>
 <div class="up"><a href="wincache.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
